package com.mytest.provider.ff.controller;

import com.google.common.collect.Maps;
import com.myrest.provider.poi.work.entities.user.SysUser;
import com.mytest.provider.ff.client.userFen;
import com.mytest.provider.ff.listen.MqListen;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: llq
 * @Date: 2020/4/1
 */
@RestController
@RequestMapping("/ff")
public class ffController {

    @Autowired
    userFen userFen;

    @Autowired
    MqListen mqListen;

    @GetMapping("/sel")
    public SysUser selUser(){
        Map<String, Object> userMap = Maps.newHashMap();
        return userFen.selectUser(userMap);
    }

    @GetMapping("/mq")
    public void mq(String message){
        Map<String, Object> userMap = Maps.newHashMap();
        if (StringUtils.isNotEmpty(message)) {
            SysUser sysUser = userFen.insertUser(userMap);
            System.out.println("123 : "+sysUser);
        }
        System.out.println("false");
    }
}
